<!DOCTYPE html>
<html>
<head>
    <title>常量属性生成</title>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
</head>
<style>
    input, textarea {
        width: 700px;
    }
    #result{
        height: 500px;
    }
</style>
<body>

<table>
    <tr>
    </tr>
    <tr>
        <td>内容</td>
        <td>
            <textarea type="text" id="data"></textarea>
        </td>

    </tr>
    <tr>
        <td>结果</td>
        <td>
            <textarea id="result" ></textarea>
        </td>
    </tr>

</table>
<button onclick="generate()">生成</button>
<script type="text/javascript">
    function generate() {
        var data = $('#data').val();
        var arr = data.split(",");
        var str="";
        for (var i = 0; i < arr.length; i++) {
            var item = arr[i];
            str+=item.substr(0,item.indexOf("=>")).trim()+","
        }
        $('#result').val(str);
    }
</script>
</body>
</html>

